/*
 * @Author: xuesong
 * @Date: 2021-12-16 18:48:47
 * @LastEditors: xuesong
 * @LastEditTime: 2021-12-17 16:27:52
 * @FilePath: \BLE\projects\ble_mulit\simpleBleMultiConnection\src\mast\Display.h
 */

#ifndef __DISPLAY_H__
#define __DISPLAY_H__

#include "types.h"
// #include "CH456IF.h"
// #include "tm1640.h"
// #include "SG6932_driver.h"
#include "tm1628A.h"

#ifdef __cplusplus
extern "C"
{
#endif
//--------------------------------------------------
#define  DISPLAY_BUFF_SIZE      Driver_DISPLAY_SIZE      
//--------------------------------------------------
#define  seg_A		0x01
#define  seg_B	 	0x02
#define  seg_C	 	0x04
#define  seg_D	 	0x08
#define  seg_E	 	0x10
#define  seg_F	 	0x20
#define  seg_G	 	0x40
#define  seg_dp 	0x80
//--------------------------------------------------
typedef struct DisplayS
{
	union {
        struct
        {
            unsigned char green			: 1;    // symble 
            unsigned char red			: 1;    // symble 
            unsigned char connect		: 1;    // symble 
        }bit;
        uint32_t flag;
    } SymbleFlag;
	uint8_t  Data[2];
}Display_t;
//--------------------------------------------------
extern Display_t   DisplayData;
//--------------------------------------------------
void F_RRL_Buff_Nbit(uint8 *buffer,uint8 len,uint8 Nbit,uint8 derction);
void displayNumber(Display_t *TempDisplay,uint8_t value);
void displayAllON(Display_t *TempDisplay);
void displayClrBuf(Display_t *TempDisplay);
void displayChar2Tuble(char *str,uint8 *tempDisplay,uint8 TubleNumber);
void displayNumber2Number(uint16 data,uint8 point,uint8 *tempDisplay,uint8 TubleNumber);
void HalDisplayEvtProcss(void);
void DisplayDriverInit(void);
void Display2Driver(Display_t TempDisplayData);
void DisplayDriverPowerDown(void);
//--------------------------------------------------

#ifdef __cplusplus
}
#endif

#endif

